import request from '@/utils/request'

export default {
  getAllMenu() {
    return request({
      url: '/menu/list',
      method: 'get',
    })
  },
  getMenuList(query) {
    return request({
      url: '/menu/menuList',
      method: 'get',
      params: query,
    })
  },
  getMenuByMenuId(menuId) {
    return request({
      url: `/menu/getMenuByMenuId/${menuId}`,
      method: 'get',
    })
  },
  updateMenu(form) {
    return request({
      url: `/menu/updateMenu`,
      method: 'post',
      data: form
    })
  },
  addMenu(form) {
    return request({
      url: `/menu/addMenu`,
      method: 'post',
      data: form
    })
  },
  delMenu(id) {
    return request({
      url: `/menu/delete/${id}`,
      method: 'delete'
    })
  }
}
